/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.data;

/**
 *
 * @author nurhat
 */
public abstract class TestStepResultReciever {

    /**
     * Use this method to recieve test step result 
     * @return
     */
    public abstract TestStepResultDataObject recieve();

    /**
     * Use this method to recieve test step result 
     * @param timeout
     * @return
     */
    public abstract TestStepResultDataObject recieve(long timeout);

    /**
     * Use this method to recieve test step result  with given msgid and timeout
     * @param timeout
     * @param msgId
     * @return
     */
    public abstract TestStepResultDataObject recieve(String msgId,
            long timeout);

    /**
     * Use this method to recieve test step result  with given msgid 
     * @param msgId
     * @return
     */
    public abstract TestStepResultDataObject recieve(String msgId);

    /**
     * Use this method to retrieve  message count from a queue
     * @param timeout
     * @return
     */
    public abstract Integer retrieveCountOfMessages();

    /**
     * Use this method to retrieve  message count from a queue 
     * for the given message id
     * @param timeout
     * @return
     */
    public abstract Integer retrieveCountOfMessages(String msgId);
    protected boolean m_isAborted;

    public synchronized void abortReciever(boolean abort) {
        m_isAborted = abort;
    }

    public synchronized boolean isAborted() {
        return m_isAborted;
    }
}
